package list;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.popupwindowdemo.R;

import java.util.List;

/**
 * Created by Administrator on 2017/5/27/027.
 */

public class AdapterByJBFX extends BaseAdapter {
    private Context mContext;
    private List<String> list;

    private class  ViewHolder {
        private ImageView mDataImage;//资料图片
    }

    public AdapterByJBFX(Context context, List<String> list) {
        this.mContext = context;
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (convertView == null) {
            holder = new ViewHolder();
            convertView = View.inflate(mContext, R.layout.item_jbfx, null);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        return convertView;
    }


}